home *** CD-ROM | disk | FTP | other *** search
-
-
-
- BPROF(1) BPROF(1)
-
-
- NNAAMMEE
- bprof - profile per source line
-
- SSYYNNOOPPSSIISS
- bbpprrooff [_o_p_t_i_o_n_s] [_e_x_e_c_u_t_a_b_l_e [_b_m_o_n_._o_u_t ... ] ]
-
- DDEESSCCRRIIPPTTIIOONN
- bbpprrooff makes an execution profile per source line of your
- program. In other words, it gives you the time spent in
- each line of your program. This allows you to know pre-
- cisely on what part of the program to spend your efforts
- at speeding it up.
-
- To get such a profile, compile your program with -g and
- link it with -pg and the library libbmon.a. Make sure
- that the bmon library is linked immediately after your .o
- files, before any system libraries. Example:
-
- ggcccc --gg --cc ffoooo..cc
- ggcccc --gg --cc bbaarr..cc
- ggcccc --ppgg --oo ffuubbaarr ffoooo..oo bbaarr..oo --llbbmmoonn --llmm
-
- You can specify optimization flags. This will give you a
- better estimate of the program behaviour when it is opti-
- mized, but it can make the data hard to interpret as the
- relation between source and object code can be obscure.
-
- Running the program should produce a file bbmmoonn..oouutt in the
- current directory (that is the current directory of the
- program at the moment it exits). Now run bbpprrooff on your
- executable. This should produce files ffoooo..cc..bbpprrooff and
- bbaarr..cc..bbpprrooff which are the same as the corresponding source
- files, but have the time spent in each line prepended to
- that line. A '--' in the output indicates a line where no
- measurable time was spent, while a '..' indicates a line
- that is not executable at all.
-
- Time spent is measured in clock ticks, so in 1/100 of a
- second. As timing statistics are taken stochastically by
- recording the instruction each clock tick, these numbers
- are not exact and can vary from one run to another.
-
- The first non-option argument given will be taken as the
- name of the executable (default: a.out). Any further
- arguments are interpreted as the names of bmon.out files
- (default: bmon.out). If you specify more such files bbpprrooff
- takes the sum of the timings of these files.
-
- OOPPTTIIOONNSS
- --dd _d_i_r_e_c_t_o_r_y
- also use any source files in _d_i_r_e_c_t_o_r_y to make pro-
- files. You can use multiple --dd flags for multiple
- directories. The current directory is always used.
-
-
-
-
- Version 1.1 13 July 1994 1
-
-
-
-
-
- BPROF(1) BPROF(1)
-
-
- Note that in any case source files will only be
- looked for by the full path name they had at the
- moment of compilation. If you have moved them
- around since compilation, you need to recompile,
- move them back or create a symlink somewhere.
-
- --ss _s_u_f_f_i_x
- use _s_u_f_f_i_x instead of ..bbpprrooff to add to the source
- file names to get the output file names.
-
- EENNVVIIRROONNMMEENNTT
- BBPPRROOFFDDIIRR
- If this variable is set, the program will write the
- bmon.out file in that directory instead of the cur-
- rent one.
-
- FFIILLEESS
- bbmmoonn..oouutt
- contains timing data
-
- SSEEEE AALLSSOO
- gprof(1)
-
- BBUUGGSS
- I do not know of a way to get the last instruction address
- of a source line without looking at the next line. This
- means that if you link two object files, the first of
- which has been compiled with -g while the second one
- hasn't, time of the second file will be attributed to the
- last line of the first file. You can avoid any problems
- by linking the lliibbbbmmoonn..aa library (which should have been
- compiled with -g) immediately after your -g compiled files
- and before any others.
-
- Profiling will not be done while your program is blocking
- the VTALRM signal.
-
- AAUUTTHHOORR
- Bas de Bakker, who can be reached by email at
- bas@phys.uva.nl. The latest version of bbpprrooff should be
- available at sunsite.unc.edu in the directory
- /pub/Linux/devel.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Version 1.1 13 July 1994 2
-
-
-